{template common/contentheader}
<div class="setcontent">
	<div class="settitle">
		<h3>{lang admin_content_tag:admin}</h3>
	</div>
	<div class="alert alert-info mt10">
		<span class="label label-info">{lang info:admin}</span>
		{lang admin_content_tag_tip:admin}
	</div>
	<div class="setform">
		<table class="table table-striped">
        <thead>
          <tr>
            <th width="30">ID</th>
            <th width="50">{lang th_displayorder:admin}</th>
            <th width="80">{lang th_category:admin}</th>
            <th width="80">{lang tag_group_name_cn:admin}</th>
            <th width="80">{lang tag_group_name_en:admin}</th>
            <th width="200">{lang tags_content:admin}</th>
            <th width="80">{lang operation:admin}</th>
          </tr> 
        </thead>
        <tbody>
        {loop $tags $key $sm}
			<tr>  
			<td>$sm['tag_id']</td>
			<td>$sm['display_order']</td>
			<td>$sm['category_name_cn']</td>
			<td>$sm['tag_group_name_cn']</td>
			<td>$sm['tag_group_name_en']</td>
			<td>$sm['tags']</td>
			<td><a href="{url admin/contenttag?act=delete&tagid=$sm['tag_id']}">{lang delete:admin}</a> 
			<a href="{url admin/contenttag?act=edit&tagid=$sm['tag_id']}">{lang edit:admin}</a></td>
          	</tr>
		{/loop}
          
        </tbody>
		</table>
		<div class="text_c">$pages</div>
	</div>
	<div class="settitle">
		<h3>{lang add_tag:admin}</h3>
	</div>
	<div class="setform">
		<form class="pzform" method="post" action="{url admin/contenttag?act=add}" id="addform">
			
			<div class="formgroup">
				<label class="formlabel">{lang parent_category:admin}:</label>
				<div class="formcontrol">
					<select name="category_id" id="category_id">
						{loop $categories $root}
						<option value="$root['category_id']" data-name="$root['category_name_cn']">$root['category_name_cn']</option> 
						{/loop}
					</select>
				</div>
				<span class="formhelp">{lang parent_category:admin}</span>
			</div>
			
			<div class="formgroup">
				<label class="formlabel">{lang tag_group_name_cn:admin}:</label>
				<div class="formcontrol">
					<input type="text" name="tag_group_name_cn" id="tag_group_name_cn"/>
				</div>
				<span class="formhelp">{lang tag_group_name_cn:admin}</span>
			</div>
			
			<div class="formgroup">
				<label class="formlabel">{lang tag_group_name_en:admin}:</label>
				<div class="formcontrol">
					<input type="text" name="tag_group_name_en" id="tag_group_name_en"/>
				</div>
				<span class="formhelp">{lang tag_group_name_en:admin}</span>
			</div>
			
			<div class="formgroup">
				<label class="formlabel">{lang th_displayorder:admin}:</label>
				<div class="formcontrol">
					<input type="text" name="display_order" id="display_order"/>
				</div>
				<span class="formhelp">{lang th_displayorder:admin}</span>
			</div>
			
			<div class="formgroup">
				<label class="formlabel">{lang tags_content:admin}:</label>
				<div class="formcontrol">
					<textarea type="text" id="tags" name="tags" rows="3"></textarea>
				</div>
				<span class="formhelp">{lang tags_content_tip:admin}</span>
			</div>
			
			<div class="formbuttons">
				<button type="submit" class="btn btn-primary">{lang add:admin}</button>
			</div>
		</form>
	</div>
</div>
{template common/contentfooter}